#!/bin/sh
#desc: Universal Identification

# Copyright(c) 2011 OpenDomo Services SL. Licensed under GPL v3 or later

echo -n "Starting Universal Identification ..."

AUID=`cat /etc/opendomo/uid`
if test -z "$AUID"
then
	/sbin/ifconfig eth0 | grep HWaddr | cut -c 39-55 | sed -e 's/://g' > /etc/opendomo/uid
	chown admin:admin /etc/opendomo/uid
fi
/usr/bin/logger -p notice "Agent's UID is $AUID"
exit 0
